package com.sunlands.qdcy.tongzhuo.constant;

import java.util.HashMap;
import java.util.Map;

/**
 * Created with meng.
 * User: meng5
 * Date: 2019-06-26
 * Description: message中拓展属性的tabType对应的取值
 */
public enum TabType {

    //tabType: zan: 点赞，forward: 转发，reply: 回复   //798互动通知的互动类型
    zan("zan"),
    forward("forward"),
    reply("reply"),

    //标记进入群详情的那一页
    group_diary("groupDiary"),
    group_chat("groupChat"),

    //标记进入个人详情的哪一页
    person_diary("personDiary"),
    person_group("personGroup"),
    ;

    /**
     * message中拓展属性的字段名tabType
     */
    private static final String TAB_TYPE_KEY = "tabType";

    /**
     * 生成message项目参数中extra拓展属性，其中使用的值
     * @param tabType
     * @return
     */
    public static Map<String, Object> getTabTypeMap(TabType tabType){
        Map<String, Object> extraMap = new HashMap<>();
        if(tabType == null){
            return extraMap;
        }
        extraMap.put(TAB_TYPE_KEY, tabType.getCode());
        return extraMap;
    }

    private String code;

    TabType(String code) {
        this.code = code;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }


}